package Text9;
import java.util.*;
public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        while(n-->0){
            int x=scanner.nextInt();
            if(find(x)){
                System.out.println("Yes");
            } else {
                System.out.println("No");
            }
        }
    }

    private static boolean find(int x) {
        if(x<2){
            return false;
        }
        for (int i = 2; i <=x/i ; i++) {
            if(x%i==0){
                return false;
            }
        }
        return true;
    }
}
